package com.firebugsoft.spring.cloud.hystrix.controller;

import com.firebugsoft.spring.cloud.hystrix.service.HystrixService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/hystrix-ribbon")
public class HystrixRibbonController {
    @Resource
    private HystrixService hystrixService;

    @GetMapping(value = "/service/monitor/env")
    public String serviceMonitorEnv(@RequestParam(defaultValue = "0") Long sleep) {
        return hystrixService.serviceMonitorEnv(sleep);
    }
}

